<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %>
<%@ include file="/common/taglibs.jsp"%>
<html>
	<head>
		<title>基本资料</title>
		<script type="text/javascript" src="${ctx }/scripts/plugins/date/timer.js"></script>
		<script type="text/javascript" src="${ctx }/scripts/plugins/date/dateSelector.js"></script>
		<script type="text/javascript" src="${ctx }/scripts/plugins/area/areaData.js"></script>
		<script type="text/javascript" src="${ctx }/scripts/plugins/area/areaSelector.js"></script>
		
		<script type="text/javascript" src="${ctx }/scripts/rollbook/userinfo/userinfo.js"></script>
		<script type="text/javascript">
			$(document).ready(function(){
				$("#userInfoForm").validationEngine();
			});
		</script>
	</head>
	<body>
		<div class="container_16">
			<div class="grid_3">
				<jsp:include page="/common/menu_2.jsp"/>
			</div>
			<div class="grid_${currentRole.roleType.id eq 4 ? '13 omega' : '10 alpha omega' }">
				<div class="content_top">
					<div class="left">
						<img src="${ctx }/images/data.png" />
					</div>
					<div class="right">
						<h7>${currentRole.roleType.id eq 4 ? "企业" : "个人" }设置 > 基本资料<h7/>
					</div>
					<div id="divTime" class="time">
				        <label id="lblDate"></label>
				        <label id="lblTime"></label>
				     </div>
				</div>
				<div class="content_bottom">
					<div class="reg_middle reg">
						<p></p>
						<form id="userInfoForm">
							<input type="hidden" id="id" name="id" value="${currentUser.id }" />
							<table cellpadding="0" cellspacing="0" style="width: 450px;">
								<tr>
									<td>
										<label>姓名：</label>
									</td>
									<td style="width: 200px;">
										<input class="validate[required] input" type="text" id="displayName" name="user.displayName" value="${currentUser.displayName }" />
									</td>
									<td>
										<c:if test="${currentRole.roleType.id ne 4 }">
											<label style="float: left;">可在中文姓名后添加英文名称</label>
										</c:if>&nbsp;
									</td>
								</tr>
								<c:if test="${currentRole.roleType.id ne 4 }">
									<tr>
										<td>
											<label>昵称：</label>
										</td>
										<td>
											<input class="input" type="text" id="nickName" name="userInfo.nickName" disabled="disabled" />
										</td>	
										<td>
											<label style="float: left;">只有星级用户才可使用</label>
										</td>
									</tr>
									<tr>
										<td>
											<label>性别：</label>
										</td>
										<td colspan="2">
											<select class="validate[required] input_100" id="gender" name="user.gender">
												<option value="">
													请选择
												</option>
												<option value="1" <c:if test="${currentUser.gender eq 1}">selected="selected"</c:if>>
													男
												</option>
												<option value="2" <c:if test="${currentUser.gender eq 2}">selected="selected"</c:if>>
													女
												</option>
											</select>
										</td>	
									</tr>
									<tr>
										<td>
											<label>生日：</label>
										</td>
										<td colspan="2">
											<select id="year" name="userInfo.birthYear" class="validate[required] input_60"></select>
											<select id="month" name="userInfo.birthMonth" class="validate[required] input_60"></select>
											<select id="date" name="userInfo.birthDay" class="validate[required] input_60"></select>
										</td>	
									</tr>
								</c:if>	
								<tr>
									<td>
										<label>地区：</label>
									</td>
									<td colspan="2">
										<select id="province" name="userInfo.province" class="validate[required] input_100"></select>
									    <select id="city" name="userInfo.city" class="validate[required] input_100"></select>
									    <select id="county" name="userInfo.county" class="validate[required] input_100"></select>
									</td>	
								</tr>
								<tr>
									<td>
										&nbsp;
									</td>
									<td colspan="2">
										<label class="btn"><input type="button" value="保存" onclick="saveUserInfo()" /></label>
										<label class="btn" style="margin-left: 10px;"><input type="reset" value="重置" /></label>
									</td>	
								</tr>
							</table>
						</form>
						<p></p>
						<p></p>
						<p></p>	
					</div>	
				</div>
			</div>
			<c:if test="${currentRole.roleType.id ne 4 }">
				<jsp:include page="../sitecontent/appInfo.jsp"></jsp:include>
			</c:if>
		</div>
		<div class="container_16" style="margin-top: 50px;">
			<p></p>
		</div>
		<c:if test="${currentRole.roleType.id ne 4 }">
			<script type="text/javascript">
				new DateSelector('year', 'month', 'date', {floorYear: 120}).init();
				$("#year").val("${currentUser.userInfo.birthYear }");
				$("#month").val("${currentUser.userInfo.birthMonth }");
				$("#date").val("${currentUser.userInfo.birthDay }");
			</script>
		</c:if>
		<script type="text/javascript">
			initArea("province","","city","","county","");
	<%--		$("#province").val("${currentUser.userInfo.province }");--%>
	<%--		$("#city").val("${currentUser.userInfo.city }");--%>
	<%--		$("#county").val("${currentUser.userInfo.county }");--%>
	<%--		$("#city").append("<option value='' selected='selected'>${currentUser.userInfo.city }</option>");--%>
		</script>
	</body>
</html>